package com.qf.conf;


import com.qf.listener.MyContextLoadlistener;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ListenerConf {

    /**
     * 用于绑定我们的servlet listner的一个对象
     * @param loadlistener
     * @return
     */
    @Bean
    public ServletListenerRegistrationBean servletListenerRegistrationBean(MyContextLoadlistener loadlistener) {
        ServletListenerRegistrationBean servletListenerRegistrationBean = new ServletListenerRegistrationBean();
        servletListenerRegistrationBean.setListener(loadlistener);
        return servletListenerRegistrationBean;
    }
}
